﻿using Mapster;
using SmartAgricultureService.Tables;

namespace SmartAgricultureService.Models.Tables
{
    public class UploadInfo
    {
        public string DeviceId { get; set; }
        public long Temperature { get; set; }
        public long Humidity { get; set; }
        public long Illumination { get; set; }
        public DateTime CreateDate { get; set; }
        public static TypeAdapterConfig GetAdapterConfig()
        {
            return new TypeAdapterConfig().NewConfig<UploadEntry, UploadInfo>()
                .Map(dest => dest.DeviceId, src => src.DeviceId)
                .Map(dest => dest.Temperature, src => src.Temperature)
                .Map(dest => dest.Humidity, src => src.Humidity)
                .Map(dest => dest.Illumination, src => src.Illumination)
                .Map(dest => dest.CreateDate, src => src.CreateDate)
                .Config;
        }
    }
}